package util;

public class Dictionary {
    public static class CODE{
        public static final int SYSTEM_ERROR = 100;
        public static final int NOT_KOWN_ERROR = 101;
        public static final int SUCCESS = 200;
        public static final int IDEN_ERROR = 201;
        public static final int PASSWORD_ERROR = 202;
        /**
         * 账号过期
         */
        public static final int IDEN_EXPIRED = 203;
        /**
         * 登陆超时
         */
        public static final int LOGIN_EXPORED = 204;
        public static final int PHONE_ERROR =205;
        public static final int IDEN_IS_USED = 206;
        public static final int MSG_EMPTY = 207;
        public static final int IS_DECLARE_REPAIR = 208;
        /**
         * 文件上传错误
         */
        public static final int FILE_UPLOAD_EMPTY = 209;
        public static final int FILE_UPLOAD_TYPE_ERROR = 210;

        /**
         * 参数缺少错误
         */
        public static final int PARAM_IS_LOST = 211;
        public static final int PARAM_ERROR = 212;
        public static final int TYPE_ERROR = 213;
        /**
         * 数据库操作异常
         */
        public static final int RECORD_NOT_EXITS = 214;
        /**
         * 权限异常
         */
        public static final int NO_OPERATION_POWER = 215;

        public static final int VALIDATE_CODE_ERROR = 216;
        /**
         * 操作超时
         */
        public static final int OPERATION_TIME_OUT = 217;
        public static final int OTHER_MANAGER_OPERATION = 218;
    }

    public static class REPAIR{
        /**
         *repair type
         */
        public static final int DECLARE_TYPE_STUDENT = 1;
        public static final int DECLARE_TYPE_PUBLIC = 2;
        /**
         * repair search type
         */
        public static final int SEARCH_TYPE_HISTORY = 1;
        public static final int SEARCH_TYPE_NEW = 2;
        public static final int SEARCH_TYPE_REPAIR = 0;
        public static final int SEARCH_TYPE_OTHER = 1;
        /**
         * repair type
         */
        public static final int REPAIR_STATE_HISTORY = 0;
        /**
         * 进行中
         */
        public static final int REPAIR_STATE_INRUNNING = 1;
        /**
         * 报修分类
         */
        public static final int REPAIR_STATE_NO_READ = 1;
        public static final int REPAIR_STATE_READ = 2;
        public static final int REPAIR_STATE_HANDING = 3;
        public static final int REPAIR_STATE_REFUSE = 4;
        /**
         * ready to repair
         */
        public static final int PREPARE_REPAIR_IS_DECLARE = 0;
        public static final int PREPARE_REPAIR_SUCCESS = 1;
        /**
         * Manager to repair
         */
        public static final int MANAGE_REPAIR_NO_READ = 0;
        public static final int MANAGE_REPAIR_READ = 1;
        public static final int MANAGE_REPAIR_PREPARE = 2;
        public static final int MANAGE_REPAIR_END = 3;
    }

    public static class LOGIN{
        public static final int USER_TYPE_STUDENT = 0;
        public static final int USER_TYPE_MANAGER = 1;
        public static final String LOGIN_TOKEN_NAME ="token";
    }

    public static class MANAGER{
        public static final int MANGER_SUPER = 0;
        public static final int MANAGER_NORMAL = 1;
        public static final int MANGER_INTERIM =2;
        public static final int MANAGER_IS_USER = 1;
        public static final int MANAGER_NOT_USER = 0;
    }

    public static class TABLE{
        public static final int TABLE_STUDENT_REPAIR = 0;
        public static final int TABLE_OTHER_QUESTION = 1;
        public static final int TABLE_USER_PIC = 2;
    }
    public static class REDIS{
        public static final long DEFAULT_TIME = 24*60*60;//一天

    }
    public static class TREE{
        public static final Integer TOP = 0;

    }
    public static class TITLE{
        public static final String getTitle(int state){
            switch (state){
                case REPAIR.REPAIR_STATE_HISTORY :return "历史记录";
                case REPAIR.REPAIR_STATE_NO_READ :return "未读消息";
                case REPAIR.REPAIR_STATE_READ :return "处理中";
                case REPAIR.REPAIR_STATE_HANDING :return "处理中";
                case REPAIR.REPAIR_STATE_REFUSE :return "被拒处理";
                default: return "未知记录";
            }
        }
    }
}
